package com.soft.line.service.impl;

import com.soft.line.entity.LasUserInfo;
import com.soft.line.mapper.LasUserInfoMapper;
import com.soft.line.service.LasUserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class LasUserInfoServiceImpl implements LasUserInfoService {

    @Autowired
    private LasUserInfoMapper lasUserInfoMapper;

    @Override
    public List<LasUserInfo> selectUserInfoForConDep() {
        return lasUserInfoMapper.selectUserForConDep();
    }

    @Override
    public boolean isRegister(Integer userId) {
        boolean flg = false;
        if (lasUserInfoMapper.countRegister(userId) > 0) {
            flg = true;
        }
        return flg;
    }

    @Override
    public boolean isDepManager(Integer userId) {
        boolean flg = false;
        if (lasUserInfoMapper.countDepManager(userId) > 0) {
            flg = true;
        }
        return flg;
    }

    @Override
    public boolean isAssistantManager(Integer userId) {
        boolean flg = false;
        if (lasUserInfoMapper.countAssistantManager(userId) > 0) {
            flg = true;
        }
        return flg;
    }
}
